cmake_minimum_required(VERSION 3.13.4)

include(cmake/SparkWithGit.cmake)

project(linglong-apps-analyzer LANGUAGES CXX VERSION 0.0.2)

spark_initialize_modules()

spark_add_links_qt(
    Concurrent
)

# 资源文件路径
set(QRC_SOURCES "")

spark_add_executable_path(${PROJECT_NAME} 
    src
    src/widgets
    src/widgets/picimage
    src/view
    src/res
    ${QRC_SOURCES}
)

target_link_qt5(${PROJECT_NAME})
target_link_qt_concurrent(${PROJECT_NAME})

spark_framework_include_with_git(${PROJECT_NAME} 
    https://gitee.com/spark-framework-libs/spark-framework-features
    FEATURES version screenutil)

spark_framework_include_with_git(${PROJECT_NAME}
    https://gitee.com/spark-framework-libs/network-access-libs
    FEATURES httpmanager)

spark_framework_include_with_git(${PROJECT_NAME}
    https://gitee.com/spark-framework-libs/simple-frameless-libs
    FEATURES frameless)

# 部分用例
option(ENABLE_BUILD_EXAMPLES "Enable Build Examples." OFF)
if(ENABLE_BUILD_EXAMPLES)
    include(examples/dev.cmake)
endif(ENABLE_BUILD_EXAMPLES)

# include(cmake/SparkDesktopMacros.cmake)
# 内容默认应用名称: Name= 应与项目名称相同
spark_desktop_macros(
    # 应用名称: Name=
    "LingLong Apps Analyzer"
    # 应用名称: Name[zh_CN]=
    "LingLong Apps 分析工具"
    # 应用说明: Comment=
    ""
    # 应用类型: Type=
    "Application"
    # 执行程序: Exec=
    "/opt/apps/com.gitee.zinface.linglong-apps-analyzer/bin/linglong-apps-analyzer"
    # 图标路径: Icon=
    "/opt/apps/com.gitee.zinface.linglong-apps-analyzer/icon/icon.svg"
    # 应用分类: Categories=
    "Utility"
    # MIME类型: MimeType=
    ""
)

# 安装快捷方式
spark_install_file(/usr/share/applications 
    ${SPARK_DESKTOP_FILE})
# 安装图标
spark_install_file(/opt/apps/com.gitee.zinface.linglong-apps-analyzer/icon 
    src/res/icon.svg)
# 安装目标
spark_install_target(/opt/apps/com.gitee.zinface.linglong-apps-analyzer/bin 
    linglong-apps-analyzer)

add_package_descript(cmake/spark-deb-package.descript)
